Logic programming beyond Prolog

نویسنده

  • M. H. van Emden
چکیده

A logic program is an executable specification. For example, merge sort in pure Prolog is a logical formula, yet shows creditable performance on long linked lists. But such executable specifications are a compromise: the logic is distorted by algorithmic considerations, yet only indirectly executable via an abstract machine. This paper introduces relational programming, a method that solves the difficulty with logic programming by a separation of concerns. It requires three texts: (1) the axioms, a logical formula that specifies the problem and is not compromised by algorithmic considerations, (2) the theorem, a logical formula that expresses the idea of the algorithm and follows from the axioms, and (3) the code, a transcription of the theorem to a procedural language. Correctness of the code relies on the logical relationship of the theorem with the axioms and relies on an accurate transcription of the theorem to the procedural language. Sorting is an example where relational programming has the advantage of a higher degree of abstractness: the data to be sorted can be any data type in C++ (the procedural language we use in our examples) that satisfies the axioms of linear order, while the pure-Prolog version is limited to data structures in the form of linked cells. We show another advantage of relational programs: they have a model-theoretic and fixpoint semantics equivalent to each other and analogous to those of pure Prolog programs.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Representing Knowledge in A-Prolog

In this paper, we review some recent work on declarative logic programming languages based on stable models/answer sets semantics of logic programs. These languages, gathered together under the name of A-Prolog, can be used to represent various types of knowledge about the world. By way of example we demonstrate how the corresponding representations together with inference mechanisms associated...

متن کامل

Learning in Clausal Logic: A Perspective on Inductive Logic Programming

Inductive logic programming is a form of machine learning from examples which employs the representation formalism of clausal logic. One of the earliest inductive logic programming systems was Ehud Shapiro’s Model Inference System [90], which could synthesise simple recursive programs like append/3. Many of the techniques devised by Shapiro, such as top-down search of program clauses by refinem...

متن کامل

An Overview of the Andorra Kernel Language

The Andorra Kernel Language (AKL) is a general combination of search-oriented nondeterministic languages, such as Prolog, and the process-oriented committedchoice languages, such as GHC [10, 8, 9]. For an introduction to the language from this perspective, see [7]. For an extensive formal treatment, see [4]. Although the Prolog programming paradigm is provided, AKL does not provide the exact op...

متن کامل

Classical Negation in Logic Programs

The purpose of this work is to extend logic programming beyond normal programs, as defined in [Lloy87], and thus beyond(positive) definite clause programming, by allowing also definite negative heads. Thus we admit program clauses with both positive and (classically) negated atoms conjoined in the body, and at most one literal as its head (clauses with disjunctions of literals in the head are t...

متن کامل

Transformation Systems and Nondeclarative Properties

Program transformation systems are applied both in program synthesis and in program optimization. For logic programs the “logic” component makes transformations very natural and easy to be studied formally. But, when we move to Prolog programs, the “control” component cannot be ignored. In particular we need to cope with termination properties which are essential for ensuring the reachability o...

متن کامل

Towards Logic Programming as a Service: Experiments in tuProlog

In this paper we explore the perspective of Logic Programming as a Service (LPaaS), with a broad notion of “service” going beyond the mere handling of the logic engine lifecycle, knowledge base management, reasoning queries execution, etc. In particular, we present tuProlog as-a-service, a Prolog engine based on the tuProlog core made available as an encapsulated service to effectively support ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:
  • CoRR

دوره abs/1412.3480  شماره 

صفحات  -

تاریخ انتشار 2014